package com.yudidi;

import com.yudidi.beanpostprocessor.NameBeanPostProcessor;
import com.yudidi.service.DemoService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by didi on 23/05/2018.
 */
public class BeanPostProcessorTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        DemoService demoService = (DemoService) context.getBean("demoService");
        demoService.sayHello();
        NameBeanPostProcessor nameBeanPostProcessor = (NameBeanPostProcessor) context.getBean("nameBeanPostProcessor");
        System.out.println(nameBeanPostProcessor.getName());
    }
}